Scenario #5000: Subscribe New Person and Contact to Mailinglist

UseCase Subscribe New Person And Contact To Mailinglist => Subscription: Michael Miller to operations-announce

Properties

Required

Given

name value
partnerPersonTradeName Test AG
subscriberFamilyName Miller
subscriberGivenName Michael
subscriberEMailAddress michael.miller@example.org
mailingList operations-announce

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Create Subscription: Michael Miller to operations-announce

HTTP POST "/api/hs/office/relations" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  -H 'Content-Type: application/json' \
  --data-binary @- <<EOF
{
  "type" : "SUBSCRIBER",
  "mark" : "operations-announce",
  "anchor.uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // Person: Test AG
  "holder" : {
    "personType" : "NATURAL_PERSON",
    "familyName" : "Miller",
    "givenName" : "Michael"
  },
  "contact" : {
    "caption" : "Michael Miller",
    "emailAddresses" : {
      "main" : "michael.miller@example.org"
    }
  }
}
EOF
=> status: 201 CREATED 6564094f-4700-48a4-a68a-afe70d1f3729

generated on 2026-07-17 01:44:27 for branch